<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/jsp/base/taglibs.jsp"%>
<%@include file="/WEB-INF/jsp/base/head.jsp"%> 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head> 

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>非该角色权限</title>
</head>
<body>
	<div id="page-top">
		<span>非该角色权限列表</span>
		<b></b><i></i>
	</div>
  
	<div id="page"> 
       
       <s:form id="form1" namespace="/system" action="roleAction" name="form1" method="post">
       		<input type="hidden" name="roleId" value='<s:property value="roleId"/>'/>
            <div id="search">
       			 <span>权限名称：</span><input class="form-text" type="text" name="authorityBizBean.name" value='<s:property value="authorityBizBean.name"/>' />
			</div>
			
			<div id="search-btn-wapper">
				<s:submit cssClass="btn"  method="getNotRoleAuth" value="查询"></s:submit>
			</div>
            
			<div id="btn-option">
				<a class="add-btn" onclick="addRoleAuth();"  href="javascript:void(0);" title="增加">增加</a>
			</div>
			
            <div id="item-list">
				<table>
				   <thead>
				     <tr>
						<th>选择<input type="checkbox" id="selectAll" /></th>
						<th>序号</th>
						<th>权限名称</th>
						<th>权限描述</th>
					 </tr>
				   </thead>
				   <tbody>
						<s:iterator value="authList" var="r" status="sta"> 
						<tr>
							<td><input type="checkbox" class="classCheckBox" name="authIdList" value='<s:property value="#r.id"/>' /></td>
							<td><s:property value="#sta.index+1"/></td>
							<td><s:property value="#r.name"/></td>
							<td><s:property value="#r.description"/></td>
						</tr>
						</s:iterator>
						<s:if test="authList == null || authList.size == 0">
						    <tr>
						       <td colspan="4">数据暂无!</td>
						    </tr>
						</s:if>
					</tbody>
				</table>
			</div>
       </s:form>
    </div>
    <div id="page-bottom">
    	<b></b><i></i>
		<d:page namespace="/system" action="roleAction!getNotRoleAuth">
		</d:page>
	</div>
</body> 
<script type="text/javascript">
	var addRoleAuth = function() {
		var checkBoxes = document.getElementsByName("authIdList");
		var userIds = "";
		for(var i = 0; i < checkBoxes.length; i++){
			if(checkBoxes[i].checked == true){
				userIds += checkBoxes[i].value;
				if (i != checkBoxes.length - 1) {
					userIds +=",";
				}
			}
		}
		if (userIds != "") {
			window.returnValue=userIds;
			if(navigator.userAgent.indexOf("MSIE") <= 0) {
				window.opener.ReturnValue = userIds;
			}
			window.close();
		} else {
			alert("您，还没有选择数据！");
			return false;
		}
	};
</script>
</html>